package com.ellecity06.cwhiskymall.ui.shop9000.dialog

import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import com.ellecity06.common.base.BaseDialog
import com.ellecity06.cwhiskymall.databinding.DialogReceiveShop9000Binding

/**
 * @author ellecity06
 * @time 2024/10/30 14:16
 * @des
 */
class Shop9000ReceiveDialog(
    val context: Activity,
    private val amount: String,
    val onReceive: () -> Unit,
    val onToHome: () -> Unit
) : BaseDialog<DialogReceiveShop9000Binding>(context), View.OnClickListener {
    override val widthP: Float
        get() = 1F

    override fun inflaterViewBinding(): DialogReceiveShop9000Binding {
        return DialogReceiveShop9000Binding.inflate(LayoutInflater.from(context))
    }

    override fun initialize() {
        binding.ivClose.setOnClickListener(this)
        binding.tvSingleReceive.setOnClickListener(this)
    }

    override fun onClick(view: View?) {
        when (view?.id) {

            binding.tvSingleReceive.id -> {
                dismiss()
                onReceive.invoke()
            }

            binding.ivClose.id -> {
                dismiss()
            }
        }
    }

}